﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Rules;

public class CommandCenter : MonoBehaviour
{
    public static void GameOrder(Chessman chessman, Location target, bool ignorePlayerColor = false, bool swapPlayersAfterMovement = true)
    {
        if (!ignorePlayerColor)
        {
            if (chessman.camp != PlayerManager.Get.currentPlayer)
            {
                return;
            }
        }

        if (chessman.CanMoveTo(target))
        {
            chessman.MoveTo(target, swapPlayersAfterMovement);
        }
    }
}
